<template>
  <div class="grandson1">
    <h1>我是Grandson1组件</h1>
    <h2>我有一盒牛奶：{{milk}}</h2>
    <button @click="handleClick">牛奶给叔叔传过去</button>
  </div>
</template>

<script>
  export default {
    name:'Grandson1',
    data() {
      return {
        milk:'伊利'
      }
    },
    methods: {
      handleClick(){
        this.$bus.$emit('send-milk',this.milk)
      }
    },
  }
</script>

<style>
  .grandson1 {
    background-color: yellow;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px black;
  }
</style>